﻿using FluentValidation.Attributes;
using Nop.Admin.Validators.WindAlert;
using Nop.Web.Framework;
using Nop.Web.Framework.Localization;
using Nop.Web.Framework.Mvc;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Nop.Admin.Models.WindAlert
{
    [Validator(typeof(SpotValidator))]
    public partial class SpotModel : BaseNopEntityModel, ILocalizedModel<SpotLocalizedModel>
    {
        public SpotModel()
        {
            AvailableCameras = new List<CameraModel>();
            Locales = new List<SpotLocalizedModel>();
        }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Name")]
        [AllowHtml]
        public string Name { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Description")]
        [AllowHtml]
        public string Description { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaKeywords")]
        [AllowHtml]
        public string MetaKeywords { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaDescription")]
        [AllowHtml]
        public string MetaDescription { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaTitle")]
        [AllowHtml]
        public string MetaTitle { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.SeName")]
        [AllowHtml]
        public string SeName { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Published")]
        public bool Published { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Deleted")]
        public bool Deleted { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.DisplayOrder")]
        public int DisplayOrder { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.lat")]
        public double lat { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.lng")]
        public double lng { get; set; }

        public IList<SpotLocalizedModel> Locales { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.ShowOnHome")]
        public virtual bool ShowOnHome { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.ShowOnAviasion")]
        public virtual bool ShowOnAviasion { get; set; }

        //station 
        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.IsStation")]
        public virtual bool IsStation { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.StationAdjustTime")]
        public virtual int StationAdjustTime { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.StationDataUrl")]
        public virtual string StationDataUrl { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.StationSplitMethod")]
        public virtual int StationSplitMethod { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.StationIsMetar")]
        public virtual bool StationIsMetar { get; set; }

        //wave   
        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.IsWave")]
        public virtual bool IsWave { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.WaveDataUrl")]
        [AllowHtml]
        public string WaveDataUrl { get; set; }
        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.WaveAdjustTime")]
        public int WaveAdjustTime { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.IsForecast")]
        public bool IsForecast { get; set; }

       


        //Cameras and Stations
        [NopResourceDisplayName("Admin.Customers.Spots.Fields.Stations")]
        public string StationNames { get; set; }
        public List<CameraModel> AvailableCameras { get; set; }
        public int[] SelectedStationIds { get; set; }
        
        [NopResourceDisplayName("Admin.Customers.Spots.Fields.Cameras")]
        public string CameraNames { get; set; }
        public int[] SelectedCameraIds { get; set; }

        #region Nested classes


        #endregion
    }

    public partial class SpotLocalizedModel : ILocalizedModelLocal
    {
        public int LanguageId { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Name")]
        [AllowHtml]
        public string Name { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.Description")]
        [AllowHtml]
        public string Description { get; set; }
                                 
        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaKeywords")]
        [AllowHtml]
        public string MetaKeywords { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaDescription")]
        [AllowHtml]
        public string MetaDescription { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.MetaTitle")]
        [AllowHtml]
        public string MetaTitle { get; set; }

        [NopResourceDisplayName("Admin.WindAlert.Spots.Fields.SeName")]
        [AllowHtml]
        public string SeName { get; set; }
    }
}